import request from '@/config/axios'

// 菜单管理列表查询
export const getMenuTableListApi = (params: any): Promise<IResponse> => {
  return request.get({ url: '/sys/permission/list', params })
}

// 重复校验
export const duplicateCheck = (params: any) => {
  return request.get({ url: '/sys/duplicate/check', params })
}
// 新增菜单管理
export const addPermission = (data: any) => {
  return request.post({ url: '/sys/permission/add', data })
}
// 编辑菜单管理
export const editPermission = (data: any) => {
  return request.post({ url: '/sys/permission/edit', data })
}
// 获取全部的权限树
export const getMenuTableTreeApi = (): Promise<IMoreResponse> => {
  return request.get({ url: '/sys/permission/queryTreeList' })
}
// 删除菜单
export const delIdApi = (params: any): Promise<IResponse> => {
  return request.delete({ url: '/sys/permission/delete', params })
}
// 批量删除菜单
export const deleteBatchIdApi = (params: any): Promise<IResponse> => {
  return request.delete({ url: '/sys/permission/deleteBatch', params })
}
export const delTableListApi = (ids: string[] | number[]): Promise<IResponse> => {
  return request.post({ url: '/example/delete', data: { ids } })
}
